home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 34.zip
/
BS1 part 34
/
utildisk 6 omitech.adf
/
DOCS
/
copperbobs.S
< prev
next >
Wrap
Text File
|
1990-03-10
|
15KB
|
595 lines
*********************************************************
* *
* Eine Copper-Blitter-Coproduktion... *
* *
* (c) '90 by MIC/L4 *
*********************************************************
;---- Bob-Competition ---- (die genialste Bob-Routine...)
; (... aber leider nicht die schnellste)
balls = 192
balldaten = $40000
ballmasken = balldaten+[balls*15*4]
anz_tabs = 20
ytable = ballmasken+[ballmasken-balldaten]
xtable = ytable+[200*2*anz_tabs]
shifttable = xtable+[320*2*anz_tabs]
jmp start
org $20000
load $20000
d:
start:
move.l 4.w,a6
lea grafname(pc),a1
jsr -408(a6)
move.l d0,a1
move.l 38(a1),oldcopper
jsr -414(a6)
move.w $dff002,olddma
or.w #$8000,olddma
move.w $dff01c,oldint
or.w #$8000,oldint
move.w #$7fff,$dff09a
move.w #$7fff,$dff096
bsr.l prog_begin
move.l oldcopper(pc),$dff080
move.w #$7fff,$dff09a
move.w #$7fff,$dff096
move.l oldcopper(pc),$dff080
clr.w $dff088
move.w olddma(pc),$dff096
move.w oldint(pc),$dff09a
rts
prog_begin:
lea $60000,a0
lea $80000,a1
moveq #0,d0
clr_all:
move.l d0,(a0)+
; addq.l #1,d0
cmp.l a1,a0
blt.s clr_all
bsr.l init_balls
bsr.l init_clear
bsr.l init_curve
bsr.l init_customregs
sync_rein:
cmp.b #255,$dff006
bne.s sync_rein
move.l #clist,$dff080
clr.w $dff088
move.w #$8080,$dff096
move.l $6c.w,oldvbl
move.l #newvbl,$6c.w
move.w #$c020,$dff09a ;vbl-int erlauben
lea $dff180,a5
mouse:
; move.w #$00f,(a5)
; move.w #$0ff,(a5)
btst #6,$bfe001
bne.s mouse
move.l oldvbl(pc),$6c.w ;alter vbl-int
rts
curve_shiftpt: dc.l shifttable
curve_xpt: dc.l xtable
curve_ypt: dc.l ytable
curve_xmod: dc.w 8
curve_ymod: dc.w 10
xspeed: dc.w 4
yspeed: dc.w 2
bl = 216
pl = 400-bl
oldvbl: dc.l 0
newvbl:
move.w #$0070,$dff09c ;level3-int loeschen
move.l logbase(pc),a6
lea 64*2*200(a6),a6
moveq #0,d0
move.l d0,d1
move.l d0,d2
move.l d0,d3
move.l d0,d4
move.l d0,d5
move.l d0,d6
move.l d0,a0
move.l d0,a1
move.l d0,a2
moveq #24,d7 ;64-40 = 24
clear_proz:
sub.l d7,a6
movem.l d0-d6/a0-a2,-(a6)
clear_proz_list:
blk.w [pl-1]*3,0
move.w #$8080,$dff096
move.w #$f00,$dff180
lea d(pc),a6
move.w logbase(pc),d0
move.w physbase(pc),logbase-d(a6) ;lo-wort immer gleich
move.w d0,physbase-d(a6)
move.l #$000000fe,$dff180 ;farbe 0 und 1
move.l #$005c0017,$dff184 ;farbe 2 und 3
move.l curve_shiftpt(pc),d0 ;zeiger auf shiftwerte
move.w d0,clist_shiftpt+6-d(a6)
move.w d0,clist2_shiftpt+6-d(a6)
swap d0
move.w d0,clist_shiftpt+2-d(a6)
move.w d0,clist2_shiftpt+2-d(a6)
move.w curve_xmod(pc),clist_xcu+2-d(a6) ;x-sinus
move.w curve_xmod(pc),clist2_xcu+2-d(a6)
move.l curve_xpt(pc),d0 ;x-zeiger
move.w d0,clist_xpt+6-d(a6)
move.w d0,clist2_xpt+6-d(a6)
swap d0
move.w d0,clist_xpt+2-d(a6)
move.w d0,clist2_xpt+2-d(a6)
move.l curve_ypt(pc),d0 ;x-zeiger
move.w d0,clist_ypt+6-d(a6)
move.w d0,clist2_ypt+6-d(a6)
swap d0
move.w d0,clist_ypt+2-d(a6)
move.w d0,clist2_ypt+2-d(a6)
move.w curve_ymod(pc),clist_ycu+2-d(a6) ;x-sinus
move.w curve_ymod(pc),clist2_ycu+2-d(a6)
move.l curve_shiftpt(pc),a0
move.l curve_xpt(pc),a1
add.w xspeed(pc),a0
add.w xspeed(pc),a1
cmp.l #shifttable+[320*2],a0
blt.s curves_ok
lea -[320*2](a0),a0
lea -[320*2](a1),a1
curves_ok:
move.l a0,curve_shiftpt-d(a6)
move.l a1,curve_xpt-d(a6)
move.l curve_ypt(pc),a0
add.w yspeed(pc),a0
cmp.l #ytable+[200*2],a0
blt.s curves2_ok
lea -[200*2](a0),a0
curves2_ok:
move.l a0,curve_ypt
rte
stack: dc.l 0
clear_buf: blk.l 16,0
init_clear:
lea clear_proz,a0
lea clear_proz_list,a1
lea clear_proz+[pl*6],a2 ;ende
init_clr_l:
move.w (a0)+,(a1)+
cmp.l a2,a1
blt.s init_clr_l
rts
init_curve:
lea ytable,a0
moveq #anz_tabs-1,d0
init_cu1:
lea y_tab,a1
move.w #200-1,d1
init_cu2:
move.w (a1)+,d2
lsl.w #7,d2 ;*128
move.w d2,(a0)+
dbra d1,init_cu2
dbra d0,init_cu1
lea xtable,a0
moveq #anz_tabs-1,d0
init_cu3:
lea x_tab,a1
move.w #320-1,d1
init_cu4:
move.w (a1)+,(a0)+
dbra d1,init_cu4
dbra d0,init_cu3
lea shifttable,a0
moveq #anz_tabs-1,d0
init_cu5:
lea shift_tab,a1
move.w #320-1,d1
init_cu6:
move.w (a1)+,(a0)+
dbra d1,init_cu6
dbra d0,init_cu5
rts
init_balls:
lea balldaten,a0
lea balldaten+[15*4],a1
lea ballmasken,a2
lea ballmasken+[15*4],a3
move.w #balls*15-1,d0
init_balls_l:
move.l (a0)+,(a1)+ ;daten
move.l (a2)+,(a3)+ ;masken
dbra d0,init_balls_l
lea blit_clist,a0
lea blit_rout,a1
lea blit_rout2,a2
lea blit_rout_end,a3
copy_blit_rout:
move.w (a0),(a1)+
move.w (a0)+,(a2)+
cmp.l a3,a1
blt.s copy_blit_rout
rts
grafname: dc.b "graphics.library",0
even
oldcopper: dc.l 0
olddma: dc.w 0
oldint: dc.w 0
logbase: dc.l $60000
physbase: dc.l $70000
init_customregs:
lea $dff000,a0
move.w #$2981,$8e(a0)
move.w #$f1c1,$90(a0) ;screenhoehe,breite
move.w #$0038,$92(a0) ;ddf-start
move.w #$00d0,$94(a0) ;ddf-stop
move.w #128-40,$108(a0)
move.w #128-40,$10a(a0) ;screen-modulos
move.w #0,$104(a0) ;prioritaet
move.w #0,$102(a0)
move.w #0,$144(a0)
move.w #0,$146(a0) ;sprites aus
move.w #$ffff,$2e(a0) ;blits durch copper !
move.w #$8740,$96(a0)
rts
clist: ;nur zum blitten der bobs !!!
dc.l $00e00007,$00e20000
dc.l $00e40007,$00e60040 ;planes
dc.l $01800000
dc.l $01002200
dc.l $00010000 ;waitblit
dc.l $0044ffff
dc.l $0046ffff
dc.l $004009f0 ;shiftwerte kopieren
clist_shiftpt:
dc.l $00500000+[shifttable/$10000]
dc.l $00520000+[shifttable&$ffff]
dc.l $00540000+[blit_clist+2/$10000]
dc.l $00560000+[blit_clist+2&$ffff]
dc.l $00660016 ;zielmod = 22
clist_xcu:
dc.l $00640000
dc.l $00580000+[balls*64+1]
dc.l $00010000
dc.l $00400dfc ;y+x = y or x (bei 128 breite)
dc.l $00420000
clist_xpt:
dc.l $00500000+[xtable/$10000] ;fuer x-offsets
dc.l $00520000+[xtable&$ffff]
clist_ypt:
dc.l $004c0000+[ytable/$10000] ;fuer y-wert
dc.l $004e0000+[ytable&$ffff]
dc.l $00540000+[blit_clist+10/$10000]
dc.l $00560000+[blit_clist+10&$ffff]
clist_ycu:
dc.l $00620000
dc.l $00580000+[balls*64+1]
dc.l $00010000
;-- hier werden firstwordmask und ziel verdoppelt !
dc.l $004009f0 ;einfaches kopieren
dc.l $0044f000 ;nur oberes nibble
dc.l $0046ffff
dc.l $00640000+22
dc.l $00660000+22
dc.l $00500000+[blit_clist+2/$10000]
dc.l $00520000+[blit_clist+2&$ffff]
dc.l $00540000+[blit_clist+6/$10000]
dc.l $00560000+[blit_clist+6&$ffff]
dc.l $00580000+[balls*64+1]
dc.l $00010000
dc.l $0044ffff ;jetzt ziele kopieren
dc.l $00500000+[blit_clist+10/$10000]
dc.l $00520000+[blit_clist+10&$ffff]
dc.l $00540000+[blit_clist+14/$10000]
dc.l $00560000+[blit_clist+14&$ffff]
dc.l $00580000+[balls*64+1]
dc.l $00010000
;-- an hier blitten
dc.l $0060003c,$0066003c ;screen: 64-4 = 60
dc.l $0062fffe,$0064fffe ;daten: -2 wegen shiftung
dc.l $00500000+[ballmasken/$10000] ;hi-zeiger auf masken
dc.l $00520000+[ballmasken&$ffff] ;lo-zeiger auf masken
dc.l $004c0000+[balldaten/$10000] ;hi-zeiger auf daten
dc.l $004e0000+[balldaten&$ffff] ;lo-zeiger auf daten
dc.l $0044ffff,$00460000 ;anfangs und endmask
dc.l $00540006 ;dpt
dc.l $00480006 ;cpt
dc.l $00800000+[clist2/$10000] ;neue clist
dc.l $00820000+[clist2&$ffff]
dc.l $00960080
blit_clist:
dc.l $00400fca,$00420000
dc.l $004a0000,$00560000
dc.w $0058,15*2*64+2
dc.l $00010000 ;waitblit
blit_rout: blk.b *-blit_clist*[balls-1],0
blit_rout_end:
;-- screen loeschen
dc.l $00660018 ;modulo 24
dc.l $00400100 ;nur ziel einschalten
dc.l $00540007 ;screen bei $60000
dc.l $00560000
dc.l $00580000+[bl*64+20]
dc.l $fffffffe
clist2: ;nur zum blitten der bobs !!!
dc.l $00e00006,$00e20000
dc.l $00e40006,$00e60040 ;planes
dc.l $01800000
dc.l $01002200
dc.l $00010000 ;waitblit
dc.l $0044ffff
dc.l $0046ffff
dc.l $004009f0 ;shiftwerte kopieren
clist2_shiftpt:
dc.l $00500000+[shifttable/$10000]
dc.l $00520000+[shifttable&$ffff]
dc.l $00540000+[blit_clist2+2/$10000]
dc.l $00560000+[blit_clist2+2&$ffff]
dc.l $00660016 ;zielmod = 22
clist2_xcu:
dc.l $00640000
dc.l $00580000+[balls*64+1]
dc.l $00010000
dc.l $00400dfc ;y+x = y or x (bei 128 breite)
dc.l $00420000
clist2_xpt:
dc.l $00500000+[xtable/$10000] ;fuer x-offsets
dc.l $00520000+[xtable&$ffff]
clist2_ypt:
dc.l $004c0000+[ytable/$10000] ;fuer y-wert
dc.l $004e0000+[ytable&$ffff]
dc.l $00540000+[blit_clist2+10/$10000]
dc.l $00560000+[blit_clist2+10&$ffff]
clist2_ycu:
dc.l $00620000
dc.l $00580000+[balls*64+1]
dc.l $00010000
;-- hier werden firstwordmask und ziel verdoppelt !
dc.l $004009f0 ;einfaches kopieren
dc.l $0044f000 ;nur oberes nibble
dc.l $0046ffff
dc.l $00640000+22
dc.l $00660000+22
dc.l $00500000+[blit_clist2+2/$10000]
dc.l $00520000+[blit_clist2+2&$ffff]
dc.l $00540000+[blit_clist2+6/$10000]
dc.l $00560000+[blit_clist2+6&$ffff]
dc.l $00580000+[balls*64+1]
dc.l $00010000
dc.l $0044ffff ;jetzt ziele kopieren
dc.l $00500000+[blit_clist2+10/$10000]
dc.l $00520000+[blit_clist2+10&$ffff]
dc.l $00540000+[blit_clist2+14/$10000]
dc.l $00560000+[blit_clist2+14&$ffff]
dc.l $00580000+[balls*64+1]
dc.l $00010000
;-- an hier blitten
dc.l $0060003c,$0066003c ;screen: 64-4 = 60
dc.l $0062fffe,$0064fffe ;daten: -2 wegen shiftung
dc.l $00500000+[ballmasken/$10000] ;hi-zeiger auf masken
dc.l $00520000+[ballmasken&$ffff] ;lo-zeiger auf masken
dc.l $004c0000+[balldaten/$10000] ;hi-zeiger auf daten
dc.l $004e0000+[balldaten&$ffff] ;lo-zeiger auf daten
dc.l $0044ffff,$00460000 ;anfangs und endmask
dc.l $00540007 ;dpt
dc.l $00480007 ;cpt
dc.l $00800000+[clist/$10000] ;neue clist
dc.l $00820000+[clist&$ffff]
dc.l $00960080
blit_clist2:
dc.l $00400fca,$00420000
dc.l $004a0000,$00560000
dc.w $0058,15*2*64+2
dc.l $00010000 ;waitblit
blit_rout2: blk.b *-blit_clist2*[balls-1],0
blit_rout_end2:
;-- screen loeschen
dc.l $00660018 ;modulo 24
dc.l $00400100 ;nur ziel einschalten
dc.l $00540006 ;screen bei $60000
dc.l $00560000
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A,$EFCACFCA,$9FCA7FCA
DC.L $4FCA2FCA,$FFCADFCA,$AFCA8FCA,$6FCA4FCA,$1FCAFFCA
DC.L $DFCABFCA,$9FCA7FCA,$5FCA3FCA,$1FCAFFCA,$EFCACFCA
DC.L $AFCA8FCA,$7FCA5FCA,$4FCA2FCA,$1FCA0FCA,$EFCADFCA
DC.L $CFCABFCA,$AFCA9FCA,$8FCA7FCA,$6FCA5FCA,$5FCA4FCA
DC.L $3FCA3FCA,$2FCA2FCA,$2FCA1FCA,$1FCA1FCA,$1FCA1FCA
DC.L $0FCA1FCA,$1FCA1FCA,$1FCA1FCA,$2FCA2FCA,$2FCA3FCA
DC.L $3FCA4FCA,$5FCA5FCA,$6FCA7FCA,$8FCA9FCA,$AFCABFCA
DC.L $CFCADFCA,$EFCA0FCA,$1FCA2FCA,$4FCA5FCA,$7FCA8FCA
DC.L $AFCACFCA,$EFCAFFCA,$1FCA3FCA,$5FCA7FCA,$9FCABFCA
DC.L $DFCAFFCA,$1FCA4FCA,$6FCA8FCA,$AFCADFCA,$FFCA2FCA
DC.L $4FCA7FCA,$9FCACFCA,$EFCA1FCA,$3FCA6FCA,$9FCACFCA
DC.L $EFCA1FCA,$4FCA7FCA,$AFCACFCA,$FFCA2FCA,$5FCA8FCA
DC.L $BFCAEFCA,$1FCA4FCA,$7FCAAFCA,$DFCA0FCA,$3FCA6FCA
y_tab:
DC.L $00B900B8,$00B800B8,$00B800B7,$00B700B6,$00B600B5
DC.L $00B400B3,$00B200B1,$00B000AE,$00AD00AC,$00AA00A9
DC.L $00A700A5,$00A300A2,$00A0009E,$009B0099,$00970095
DC.L $00930090,$008E008B,$00890086,$00840081,$007E007C
DC.L $00790076,$00730071,$006E006B,$00680065,$0062005F
DC.L $005D005A,$00570054,$0051004E,$004B0048,$00460043
DC.L $0040003D,$003B0038,$00350033,$0030002E,$002B0029
DC.L $00260024,$00220020,$001E001B,$00190017,$00160014
DC.L $00120010,$000F000D,$000C000B,$00090008,$00070006
DC.L $00050004,$00030003,$00020002,$00010001,$00010001
DC.L $00000001,$00010001,$00010002,$00020003,$00030004
DC.L $00050006,$00070008,$0009000B,$000C000D,$000F0010
DC.L $00120014,$00160017,$0019001B,$001E0020,$00220024
DC.L $00260029,$002B002E,$00300033,$00350038,$003B003D
DC.L $00400043,$00460048,$004B004E,$00510054,$0057005A
DC.L $005C005F,$00620065,$0068006B,$006E0071,$00730076
DC.L $0079007C,$007E0081,$00840086,$0089008B,$008E0090
DC.L $00930095,$00970099,$009B009E,$00A000A2,$00A300A5
DC.L $00A700A9,$00AA00AC,$00AD00AE,$00B000B1,$00B200B3
DC.L $00B400B5,$00B600B6,$00B700B7,$00B800B8,$00B800B8
x_tab:
DC.L $00120012,$00120014,$00140014,$00140014,$00160016
DC.L $00160016,$00160016,$00180018,$00180018,$0018001A
DC.L $001A001A,$001A001A,$001A001C,$001C001C,$001C001C
DC.L $001C001C,$001E001E,$001E001E,$001E001E,$00200020
DC.L $00200020,$00200020,$00200020,$00220022,$00220022
DC.L $00220022,$00220022,$00220022,$00240024,$00240024
DC.L $00240024,$00240024,$00240024,$00240024,$00240024
DC.L $00240024,$00240024,$00240026,$00260026,$00260026
DC.L $00260026,$00260026,$00260026,$00240024,$00240024
DC.L $00240024,$00240024,$00240024,$00240024,$00240024
DC.L $00240024,$00240024,$00240022,$00220022,$00220022
DC.L $00220022,$00220022,$00220020,$00200020,$00200020
DC.L $00200020,$0020001E,$001E001E,$001E001E,$001E001C
DC.L $001C001C,$001C001C,$001C001C,$001A001A,$001A001A
DC.L $001A001A,$00180018,$00180018,$00180016,$00160016
DC.L $00160016,$00160014,$00140014,$00140014,$00120012
DC.L $00120012,$00120012,$00100010,$00100010,$0010000E
DC.L $000E000E,$000E000E,$000C000C,$000C000C,$000C000C
DC.L $000A000A,$000A000A,$000A000A,$00080008,$00080008
DC.L $00080008,$00060006,$00060006,$00060006,$00060004
DC.L $00040004,$00040004,$00040004,$00040002,$00020002
DC.L $00020002,$00020002,$00020002,$00020002,$00000000
DC.L $00000000,$00000000,$00000000,$00000000,$00000000
DC.L $00000000,$00000000,$00000000,$00000000,$00000000
DC.L $00000000,$00000000,$00000000,$00000000,$00000000
DC.L $00000000,$00000000,$00000000,$00000000,$00000000
DC.L $00000000,$00000002,$00020002,$00020002,$00020002
DC.L $00020002,$00020002,$00040004,$00040004,$00040004
DC.L $00040004,$00060006,$00060006,$00060006,$00060008
DC.L $00080008,$00080008,$0008000A,$000A000A,$000A000A
DC.L $000A000C,$000C000C,$000C000C,$000C000E,$000E000E
DC.L $000E000E,$00100010,$00100010,$00100012,$00120012
load balldaten
ball_dat: ;15x15 ball, 2 planes, raw-blit
dc.l $07c007c0,$14f01cf0,$12382e38
dc.l $7a2c463c,$12346e3c,$c432fc3e,$b822b83e,$806a8076
dc.l $806a8076,$c3cec3f6,$5f147fec,$606c7f9c,$33983c78
dc.l $1c701ff0,$07c007c0
load ballmasken
ball_mask: ;maske des balls (farbe 0 mitverwendet)
dc.l $07c007c0,$1ff01ff0,$3ff83ff8,$7ffc7ffc,$7ffc7ffc
dc.l $fffefffe,$fffefffe,$fffefffe,$fffefffe,$fffefffe
dc.l $7ffc7ffc,$7ffc7ffc,$3ff83ff8,$1ff01ff0,$07c007c0
End: